home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / ColorSync™ 1.0.3 / Interfaces / AIncludes / CMApplication.a next >
Encoding:
Text File  |  1993-07-19  |  8.5 KB  |  325 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CMApplication.a
  3. ;
  4. ;    Contains:    Header for Color Matching aware applications
  5. ;
  6. ;    Written by:    Tom Mohr
  7. ;
  8. ;    Copyright:    © 1992-93 by Apple Computer, Inc., all rights reserved.
  9. ;
  10. ;
  11. ;___________________________________________________________________________
  12.  IF &TYPE('__IncludingCMApplication__') = 'UNDEFINED' THEN
  13. __IncludingCMApplication__   SET 1
  14.  
  15.     IF &TYPE('__IncludingQuickEqu__') = 'UNDEFINED' THEN
  16.     INCLUDE 'QuickEqu.a'
  17.     ENDIF
  18.  
  19. gestaltColorMatchingVersion                        EQU        'cmtc'
  20.  
  21. CMTrap                                            EQU        $ABEE
  22.  
  23. ; PicComments
  24. CMBeginProfile                                    EQU        220
  25. CMEndProfile                                    EQU        221
  26. CMEnableMatching                                EQU        222
  27. CMDisableMatching                                EQU        223
  28.  
  29. ; Defines for fieldMask in profile search record
  30. kMatchCMMType                                    EQU        $00000001
  31. kMatchApplProfileVersion                        EQU        $00000002
  32. kMatchDataType                                    EQU        $00000004
  33. kMatchDeviceType                                EQU        $00000008
  34. kMatchDeviceManufacturer                        EQU        $00000010
  35. kMatchDeviceModel                                EQU        $00000020
  36. kMatchDeviceAttributes                            EQU        $00000040
  37. kMatchFlags                                        EQU        $00000080
  38. kMatchOptions                                    EQU        $00000100
  39. kMatchWhite                                        EQU        $00000200
  40. kMatchBlack                                        EQU        $00000400
  41.  
  42.  
  43. ; Profile Header version
  44. kCMApplProfileVersion                            EQU        $0100
  45.  
  46. ; Data types
  47. rgbData                                            EQU        'RGB '
  48. cmykData                                        EQU        'CMYK'
  49. grayData                                        EQU        'GRAY'
  50. xyzData                                            EQU        'XYZ '
  51.  
  52. ; Device types
  53. monitorDevice                                    EQU        'mntr'
  54. scannerDevice                                    EQU        'scnr'
  55. printerDevice                                    EQU        'prtr'
  56. qdSystemDevice                                    EQU        'sys '
  57. qdGDevice                                        EQU        'gdev'
  58.  
  59. ; Profile flags
  60. CMNativeMatchingPreferred                         EQU        $00000001        ; Default to native not preferred
  61. CMTurnOffCache                                    EQU        $00000002        ; Default to turn on CMM cache
  62.  
  63. ; Profile options
  64. CMPerceptualMatch                                EQU        $00000000        ; Default. For photographic images
  65. CMColorimetricMatch                                EQU        $00000001        ; Exact matching when possible
  66. CMSaturationMatch                                EQU        $00000002        ; For solid colors
  67.  
  68. ; ColorSync result codes
  69. CMNoError                                        EQU        0
  70. CMProfileError                                    EQU        -170
  71. CMMethodError                                    EQU        -171
  72. CMMemFullError                                    EQU        -172
  73. CMUnimplementedError                            EQU        -173
  74. CMParamError                                    EQU        -174
  75. CMMethodNotFound                                EQU        -175            ; CMM not present
  76. CMProfileNotFound                                EQU        -176            ; Responder error
  77. CMProfilesIdentical                                EQU        -177            ; Profiles the same
  78. CMCantConcatenateError                            EQU        -178            ; Profile can't be concatenated
  79. CMCantXYZ                                        EQU        -179            ; CMM cant handle XYZ space
  80. CMCantDeleteProfile                                EQU        -180            ; Responder error
  81. CMUnsupportedDataType                            EQU        -181            ; Responder error
  82. CMNoCurrentProfile                                EQU        -182            ; Responder error
  83.  
  84. grayResponse                                    EQU        0
  85. redResponse                                        EQU        1
  86. greenResponse                                    EQU        2
  87. blueResponse                                    EQU        3
  88. cyanResponse                                    EQU        4
  89. magentaResponse                                    EQU        5
  90. yellowResponse                                    EQU        6
  91. ucrResponse                                        EQU        7
  92. bgResponse                                        EQU        8
  93. onePlusLastResponse                                EQU        9
  94.  
  95. ; Printing Stuff that will be moved later
  96. enableColorMatchingOp                            EQU        12
  97. registerProfileOp                                EQU        13
  98.  
  99. ; Types
  100.  
  101. XYZColor                                        RECORD    0
  102. X                                                DS.W    1                ; 1.15 bit unsigned fixed numbers
  103. Y                                                DS.W    1
  104. Z                                                DS.W    1
  105.                                                 ENDR
  106.  
  107. CMYKColor                                        RECORD    0
  108. cyan                                            DS.W    1
  109. magenta                                            DS.W    1
  110. yellow                                            DS.W    1
  111. black                                            DS.W    1
  112.                                                 ENDR
  113.  
  114. CMColor                                            RECORD    0
  115. rgb                                                DS        RGBColor
  116.                                                 ORG        rgb
  117. xyz                                                DS        XYZColor
  118.                                                 ORG        rgb
  119. cmyk                                            DS        CMYKColor
  120. size                                            EQU        *
  121.                                                 ENDR
  122.  
  123. CMHeader                                        RECORD    0
  124. size                                            DS.L    1                ; This is the total size of the Profile including custom data
  125. CMMType                                            DS.l    1                ; Corresponding CMM
  126. applProfileVersion                                DS.L    1                ; Version of CMProfile format
  127. dataType                                        DS.L    1                ; rgbData, etc.
  128. deviceType                                        DS.L    1                ; monitorDevice, etc.
  129. deviceManufacturer                                DS.L    1                ; Registered with DTS
  130. deviceModel                                        DS.L    1                ; Specific to Manufacturer
  131. deviceAttributes                                DS.L    2                ; Attributes like paper, ink, etc.
  132. profileNameOffset                                DS.L    1                ; Offset to profile name from top of data
  133. customDataOffset                                DS.L    1                ; Offset to custom data from top of data
  134. flags                                            DS.L    1
  135. options                                            DS.L    1
  136. white                                            DS        XYZColor
  137. black                                            DS        XYZColor
  138. recordSize                                        EQU        *
  139.                                                 ENDR
  140.  
  141. CMProfileSearchRecord                            RECORD    0
  142. header                                            DS        CMHeader
  143. fieldMask                                        DS.L    1
  144. reserved                                        DS.L    2
  145. size                                            EQU        *
  146.                                                 ENDR
  147.  
  148. CMProfileChromaticities                            RECORD    0
  149. red                                                DS        XYZColor
  150. green                                            DS        XYZColor
  151. blue                                            DS        XYZColor
  152. cyan                                            DS        XYZColor
  153. magenta                                            DS        XYZColor
  154. yellow                                            DS        XYZColor
  155. size                                            EQU        *
  156.                                                 ENDR
  157.  
  158. IString                                            RECORD    0
  159. theScript                                        DS.W    1
  160. theString                                        DS.B    64                ; Str63
  161. size                                            EQU        *
  162.                                                 ENDR
  163.  
  164. CMProfileResponse                                RECORD    0
  165. counts                                            DS.W    onePlusLastResponse
  166. data                                            DS.W    1                ; Variable size
  167.                                                 ENDR
  168.  
  169. CMProfile                                        RECORD    0
  170. header                                            DS        CMHeader
  171. profile                                            DS        CMProfileChromaticities
  172. response                                        DS        CMProfileResponse ; Variable size
  173. profileName                                        DS        IString            ; Variable size
  174. customData                                        DS.W    1                ; Optional variable length custom CMM data. Word aligned.
  175.                                                 ENDR
  176.  
  177. ; Printing Stuff that will be moved later
  178. ; PrGeneral parameter blocks
  179. TEnableColorMatchingBlk                            RECORD    0
  180. iOpCode                                            DS.W    1
  181. iError                                            DS.W    1
  182. lReserved                                        DS.L    1
  183. hPrint                                            DS.L    1
  184. fEnableIt                                        DS.B    1
  185.                                                 ALIGN    2
  186. size                                            EQU        *
  187.                                                 ENDR
  188.  
  189. TRegisterProfileBlk                                RECORD    0
  190. iOpCode                                            DS.W    1
  191. iError                                            DS.W    1
  192. lReserved                                        DS.L    1
  193. hPrint                                            DS.L    1
  194. fRegisterIt                                        DS.B    1
  195.                                                 ALIGN    2
  196. size                                            EQU        *
  197.                                                 ENDR
  198.  
  199. ; High Level Calls
  200.                                                 MACRO
  201.                                                 _BeginMatching
  202.                                                 MOVE.L #$000C000A, DO
  203.                                                 DC.W    $ABEE            ; TB 03EE
  204.                                                 ENDM
  205.  
  206.                                                 MACRO
  207.                                                 _EndMatching
  208.                                                 MOVE.L #$0004000B, DO
  209.                                                 DC.W    $ABEE            ; TB 03EE
  210.                                                 ENDM
  211.  
  212.                                                 MACRO
  213.                                                 _GetProfile
  214.                                                 MOVE.L    #$00100005, D0
  215.                                                 DC.W    $ABEE            ; TB 03EE
  216.                                                 ENDM
  217.  
  218.                                                 MACRO
  219.                                                 _SetProfile
  220.                                                 MOVE.L    #$000C0006, D0
  221.                                                 DC.W    $ABEE            ; TB 03EE
  222.                                                 ENDM
  223.  
  224.                                                 MACRO
  225.                                                 _SetProfileDescription
  226.                                                 MOVE.L    #$00100010, D0
  227.                                                 DC.W    $ABEE            ; TB 03EE
  228.                                                 ENDM
  229.  
  230.                                                 MACRO
  231.                                                 _GetColorSyncFolderSpec
  232.                                                 MOVE.L    #$000C0011, D0
  233.                                                 DC.W    $ABEE            ; TB 03EE
  234.                                                 ENDM
  235.  
  236.                                                 MACRO
  237.                                                 _GetIndexedProfile
  238.                                                 MOVE.L    #$00140012, D0
  239.                                                 DC.W    $ABEE            ; TB 03EE
  240.                                                 ENDM
  241.  
  242.                                                 MACRO
  243.                                                 _DeleteDeviceProfile
  244.                                                 MOVE.L    #$000C0013, D0
  245.                                                 DC.W    $ABEE            ; TB 03EE
  246.                                                 ENDM
  247.  
  248. ; Data interchange routines
  249.                                                 MACRO
  250.                                                 _UseProfile
  251.                                                 MOVE.L    #$00040008, D0
  252.                                                 DC.W    $ABEE            ; TB 03EE
  253.                                                 ENDM
  254.  
  255.                                                 MACRO
  256.                                                 _DrawMatchedPicture
  257.                                                 MOVE.L    #$000C0009, D0
  258.                                                 DC.W    $ABEE            ; TB 03EE
  259.                                                 ENDM
  260.  
  261.                                                 MACRO
  262.                                                 _EnableMatching
  263.                                                 MOVE.L    #$0002000D, D0
  264.                                                 DC.W    $ABEE            ; TB 03EE
  265.                                                 ENDM
  266.  
  267. ; Profile concatenation
  268.                                                 MACRO
  269.                                                 _ConcatenateProfiles
  270.                                                 MOVE.L    #$000C000C, D0
  271.                                                 DC.W    $ABEE            ; TB 03EE
  272.                                                 ENDM
  273.  
  274. ; Profile manipulation routines
  275.                                                 MACRO
  276.                                                 _GetProfileName
  277.                                                 MOVE.L    #$0008000E, D0
  278.                                                 DC.W    $ABEE            ; TB 03EE
  279.                                                 ENDM
  280.  
  281.                                                 MACRO
  282.                                                 _GetProfileAdditionalDataOffset
  283.                                                 MOVE.L    #$0004000F, D0
  284.                                                 DC.W    $ABEE            ; TB 03EE
  285.                                                 ENDM
  286.  
  287. ; Low level color calculation routines
  288.                                                 MACRO
  289.                                                 _CWNewColorWorld
  290.                                                 MOVE.L    #$000C0000, D0
  291.                                                 DC.W    $ABEE            ; TB 03EE
  292.                                                 ENDM
  293.  
  294.                                                 MACRO
  295.                                                 _CWDisposeColorWorld
  296.                                                 MOVE.L    #$00040001, D0
  297.                                                 DC.W    $ABEE            ; TB 03EE
  298.                                                 ENDM
  299.  
  300.                                                 MACRO
  301.                                                 _CWMatchColors
  302.                                                 MOVE.L    #$000C0002, D0
  303.                                                 DC.W    $ABEE            ; TB 03EE
  304.                                                 ENDM
  305.  
  306.                                                 MACRO
  307.                                                 _CWCheckColors
  308.                                                 MOVE.L    #$00100003, D0
  309.                                                 DC.W    $ABEE            ; TB 03EE
  310.                                                 ENDM
  311.  
  312.                                                 MACRO
  313.                                                 _CWMatchPixMap
  314.                                                 MOVE.L    #$00100004, D0
  315.                                                 DC.W    $ABEE            ; TB 03EE
  316.                                                 ENDM
  317.  
  318.                                                 MACRO
  319.                                                 _CWCheckPixMap
  320.                                                 MOVE.L    #$00140007, D0
  321.                                                 DC.W    $ABEE            ; TB 03EE
  322.                                                 ENDM
  323.  
  324.                                                 ENDIF    ;   ...already included
  325.